package com.renchi.menu.Collection.dao;

import com.renchi.menu.Collection.entity.CollectionDbEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface CollectionDbDao extends JpaRepository<CollectionDbEntity,String> {
    @Query(value = "select *from bgd_data_collectiondb where user_id = ?",nativeQuery = true)
    List<CollectionDbEntity> findAllById(String user_id);


    @Modifying
    @Query(value = "delete from bgd_data_collectiondb where menu_url=? and user_id=?", nativeQuery = true)
    void deleteCollectionDbEntities(String menu_url,String user_id);
}
